package com;

import com.Service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestHelloSpring {
    public static void main(String[] args) {
        ApplicationContext context =
                new ClassPathXmlApplicationContext("applicationContest.xml");
        HelloSpring helloSpring = (HelloSpring) context.getBean("helloSpring");

        helloSpring.show();

        UserService userService = context.getBean (UserService.class);

        boolean flag = userService.login("张三","123");
        if (flag){
            System.out.println("登录成功");
        }else {
            System.out.println("登录失败");
        }
    }
}
